#include "gazebo/physics/physics.hh"
#include "gazebo/common/common.hh"
#include "gazebo/gazebo.hh"

namespace gazebo
{
  class FakeWorld : public WorldPlugin
  {
  public:
    void Load(gazebo::physics::WorldPtr ptr, sdf::ElementPtr sdf)
    {
      _world = ptr;
      _update_connection = gazebo::event::Events::ConnectWorldUpdateBegin(
          boost::bind(&FakeWorld::on_update, this, _1));
    };
    void on_update(const gazebo::common::UpdateInfo & /*info*/)
    {
      if (_world->PhysicsEnabled())
        _world->SetPhysicsEnabled(false);
    };

  private:
    gazebo::physics::WorldPtr _world;
    gazebo::event::ConnectionPtr _update_connection;
  };

  // Register this plugin with the simulator
  GZ_REGISTER_WORLD_PLUGIN(FakeWorld)
}